home *** CD-ROM | disk | FTP | other *** search
/ PC Answers 1998 January / PC Answers Issue 49 Cover CD January 1998.iso / Apps / Director / DATA.Z / Behavior Library.cst / 00047_UI Rollover and Mouse Down Pointer Change.ls < prev    next >
Encoding:
Text File  |  1997-05-09  |  3.9 KB  |  95 lines

  1. -- Pointer Rollover and Mouse Down, Up
  2.  
  3.  
  4.  
  5. -- a control
  6. -- Changes the cursor when the cursor rollsover the sprite
  7. property outcurs, incurs, incursSet, customImage, customMask, customDownImage, customDownMask
  8. property incursDownSet, oldcursor
  9. property useCustom, useCustomDown
  10.  
  11. on translate_cursor me, setting, image, mask, custom
  12.   if custom then
  13.     set val = [ member image, member mask ]
  14.     return val
  15.   end if
  16.   return setting
  17. end
  18.  
  19.  
  20. --- 
  21.  
  22.  
  23. on beginSprite me
  24.   set oldcursor = the cursor of sprite the spritenum of me
  25.   set val =  translate_cursor( me, the incursSet of me, customImage, customMask, useCustom )
  26.   set the cursor of sprite the spriteNum of me = val
  27.   
  28. end
  29.  
  30. on endsprite me
  31.   set the cursor of sprite the spriteNum of me = oldcursor
  32. end
  33.  
  34. on mousedown me
  35.   set val =  translate_cursor( me, the incursDownSet of me, customDownImage, customDownMask, useCustomDown )
  36.   set the cursor of sprite the spriteNum of me = val
  37. end  
  38. on mouseupOutside me
  39.   set val =  translate_cursor( me, the incursSet of me, customImage, customMask, useCustom )
  40.   set the cursor of sprite the spriteNum of me = val
  41. end
  42. on mouseup me
  43.   set val =  translate_cursor( me, the incursSet of me, customImage, customMask, useCustom )
  44.   set the cursor of sprite the spriteNum of me = val
  45. end
  46.  
  47. on getPropertyDescriptionList
  48.   
  49.   set p_list = [ ┬¼
  50.      #incursSet: [ #comment:   "Rollover Pointer Image:", ┬¼
  51.                     #format:   #cursor, ┬¼
  52.                     #default:   1 ], ┬¼
  53.        #useCustom: [ #comment: "Use Custom Pointer:", ┬¼
  54.                     #format:   #boolean, ┬¼
  55.                    #default:    FALSE ], ┬¼
  56.   #customImage: [ #comment:   "Custom Image:", ┬¼
  57.                     #format:   #bitmap, ┬¼
  58.                    #default:    member 1 ], ┬¼
  59.     #customMask: [ #comment:   "Custom Mask:", ┬¼
  60.                     #format:   #bitmap, ┬¼
  61.                    #default:    member 1 ], ┬¼
  62.      #incursDownSet: [ #comment:   "Mouse Down Pointer Image:", ┬¼
  63.                     #format:   #cursor, ┬¼
  64.                    #default:   1], ┬¼
  65.        #useCustomDown: [ #comment: "Use Custom Pointer When Mouse Down:", ┬¼
  66.                     #format:   #boolean, ┬¼
  67.                    #default:    FALSE ], ┬¼
  68.   #customDownImage: [ #comment:   "Custom Down Image:", ┬¼
  69.                     #format:   #bitmap, ┬¼
  70.                    #default:    member 1 ], ┬¼
  71.     #customDownMask: [ #comment:   "Custom Down Mask:", ┬¼
  72.                     #format:   #bitmap, ┬¼
  73.                    #default:    member 1 ] ┬¼
  74.   ]
  75.   return p_list 
  76.   
  77. end
  78.  
  79.  
  80. on getBehaviorDescription
  81.   return ┬¼
  82. "Makes the pointer image change when the pointer is over the current sprite, also defines a different pointer image to display when the sprite is clicked. Choose any of the pointers included with Director or a 1-bit bitmapped cast member." & RETURN & ┬¼
  83. "PARAMETERS:" & RETURN & ┬¼
  84. "ΓÇó Rollover Pointer Image - Choose the pointer image to appear when the pointer rolls over the sprite. Select one of Director's included pointers."  & RETURN & ┬¼
  85. "ΓÇó Use Custom Pointer - Turn this option on to specify a cast member instead of an included pointer." & RETURN & ┬¼
  86. "ΓÇó Custom Image  - ( optional ) Choose a cast member to use as the pointer image.  This choice is ignored unless Use Custom Pointer is on."  & RETURN & ┬¼
  87. "ΓÇó Custom Mask - ( optional ) Choose a cast member to use as a mask image.  "&RETURN&┬¼
  88. "ΓÇó Mouse Down Pointer Image - Choose one of Director's included pointers to be displayed when the mouse is down."  & RETURN & ┬¼
  89. "ΓÇó Use Custom Pointer When Mouse Down - Turn this option on to specify a cast member as the mouse down pointer instead of one of Director's included pointers."  & RETURN & ┬¼
  90. "ΓÇó Custom Down Image  - ( optional ) Choose a cast member to use as a pointer image when the mouse is down.  This setting is ignored unless Use Custom Pointer When Mouse Down is on."  & RETURN & ┬¼
  91. "ΓÇó Custom Down Mask - ( optional ) Choose a cast member to use as a mask image when mouse is down."
  92.   
  93. end
  94.  
  95.